02. Create a Pull Request

A pull request is a request to the original or source repository's maintainer to include changes in their project that you made in your fork of their project. You are requesting that they pull in changes you've made.

Let's get a high-level overview of what this entails and then we'll dig into the details.

L3 - Pull Request In Theory

Let's walk through the steps to issue a pull request of our own! If you've been following along then you've forked Lam's travel plans repository to your own account, and you've made one or two additional commits to your forked version.

In the previous lesson, I created a topic branch called include-richards-destinations, added a few commits to it, and pushed that branch to GitHub. Remember that when you're creating a good pull request you want to have changes on a branch that's sole reason to exist is for these changes. Remember the name for these types of branches?…topic branches!

Task Description:

We're about to create a pull request (how exciting!), so let's make sure we've both got the same setup. Please answer the following:

Task List:

Task Feedback:

Perfect, let's continue!

L3 - Pull Request In Action

You just created a pull request! Congratulations! 🙌🏼

As you can see, it's actually not too difficult to create a pull request. When I was first learning Git, GitHub, and how to collaborate, I was extremely nervous about making commits, and working with remote repos, but especially submitting a pull request to another developer's project! As long as you following the steps we covered in the previous section on:

  • reviewing the project's CONTRIBUTING.md file
  • checking out the project's existing issues
  • talking with the project maintainer

…your pull request is sure to be included!

Recap

A pull request is a request for the source repository to pull in your commits and merge them with their project. To create a pull request, a couple of things need to happen:

  • you must fork the source repository
  • clone your fork down to your machine
  • make some commits (ideally on a topic branch!)
  • push the commits back to your fork
  • create a new pull request and choose the branch that has your new commits